package com.music.client.albums.client.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Required;

import com.music.client.albums.client.AlbumClient;
import com.music.service.albums.beans.Album;
import com.music.service.albums.exceptions.AlbumPermissionDeniedException;
import com.music.service.albums.service.AlbumService;

public class AlbumClientImpl implements AlbumClient {

	private AlbumService mAlbumService;
	
	public boolean addNewAlbum(Long pMemberId, String pAlbumName) {
		return getAlbumService().addNewAlbum(pMemberId, pAlbumName);
	}

	public boolean addSongToAlbum(Long pMemberId, Long pAlbumId, Long pSongId) {
		return getAlbumService().addSongToAlbum(pMemberId, pAlbumId, pSongId);
	}

	public boolean checkMemberPermissionForAlbum(Long pMemberId, Long pAlbumId) {
		return getAlbumService().checkMemberPermissionForAlbum(pMemberId, pAlbumId);
	}

	public boolean deleteAlbum(Long pMemberId, Long pAlbumId) {
		return getAlbumService().deleteAlbum(pMemberId, pAlbumId);
	}

	public boolean deleteSongFromAlbum(Long pMemberId, Long pAlbumId,
			Long pSongId) throws AlbumPermissionDeniedException {
		return getAlbumService().deleteSongFromAlbum(pMemberId, pAlbumId, pSongId);
	}

	public boolean editAlbumName(Long pMemberId, Long pAlbumId,	String pAlbumName) {
		return getAlbumService().editAlbumName(pMemberId, pAlbumId, pAlbumName);
	}

	public List<Album> getDefaultAlbums(final Long pMemberId){
		return getAlbumService().getDefaultAlbums(pMemberId);
	}
	/**
	 * @return the albumService
	 */
	public AlbumService getAlbumService() {
		return mAlbumService;
	}

	/**
	 * @param pAlbumService the albumService to set
	 */
	@Required
	public void setAlbumService(AlbumService pAlbumService) {
		mAlbumService = pAlbumService;
	}

}
